package com.hb.trans.mvp.ui.adapter

import android.graphics.Color
import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.hb.trans.R
import com.hb.trans.bean.SearchItem
import javax.inject.Inject

class CompanySearch1Adapter(layoutResId: Int) : BaseQuickAdapter<SearchItem, BaseViewHolder>(layoutResId) {
    @Inject
    constructor() : this(R.layout.item_company_1_search)

    override fun convert(holder: BaseViewHolder, item: SearchItem) {
        item.apply {
            if(item.chosen){
                holder.getView<TextView>(R.id.item_title).setBackgroundResource(R.drawable.menu_c)
                holder.getView<TextView>(R.id.item_title).setTextColor(Color.parseColor("#333333"))

            }
            else{
                holder.getView<TextView>(R.id.item_title).setBackgroundResource(R.drawable.menu_u)
                holder.getView<TextView>(R.id.item_title).setTextColor(Color.parseColor("#999999"))

            }
            holder.setText(R.id.item_title, item.title)
        }
    }


}